﻿<Page
    x:Class="Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views.Snapped.Favourites"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels ="using:Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.ViewModels"
    xmlns:converters="using:Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Converters"
    mc:Ignorable="d" Width="300">
    <Page.Resources>
        <converters:CountToVis x:Key="countToVis"/>
    </Page.Resources>
    <Page.TopAppBar>
        <AppBar>
            <StackPanel Orientation="Horizontal">
                <Button Command="{Binding GoToHome}" Content="Home" Style="{StaticResource AppBarTextButtonStyle}" FontSize="26.667" Margin="40,0,0,0"/>
            </StackPanel>
        </AppBar>
    </Page.TopAppBar>

    <Grid Background="{StaticResource BackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="80"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="60"/>
                <ColumnDefinition  Width="*"/>
            </Grid.ColumnDefinitions>
            <Button Command="{Binding GoBack}" Grid.Column="0" Style="{StaticResource BackButtonStyle}"  Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" />
            <TextBlock x:Uid="/Content/YourFavourites" Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource SubheaderTextStyle}" Text="Your Favourites" FontFamily="{StaticResource TitleFont}" Foreground="{StaticResource TitleBrush}" />
        </Grid>
        <Grid Grid.Row="2" Margin="60,0,20,0">
            <TextBlock x:Uid="/Content/NoFavouriteMessage" Visibility="{Binding Projects.Count, Converter={StaticResource countToVis}}" Text="you have no favourites for projects - try adding some with the app bar" TextWrapping="Wrap"/>
            <ListView ItemsSource="{Binding Projects}" Tapped="ListViewTapped" ItemContainerStyle="{StaticResource ListViewItemStyle}" KeyUp="ListViewKeyUp" Margin="5,0,-5,0">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Name}" Style="{StaticResource SubheaderTextStyle}">
                                <TextBlock.Foreground>
                                    <SolidColorBrush Color="{StaticResource Title}"/>
                                </TextBlock.Foreground>
                            </TextBlock>
                            <TextBlock Text="{Binding Description}" TextWrapping="Wrap" Style="{StaticResource SubtitleTextStyle}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>
    </Grid>
</Page>